const { ccclass, property } = cc._decorator;
//主要是负责连接主域和子域，根据主域调用向字符传递相应消息的代码
@ccclass
export default class Rank extends cc.Component {


    protected onLoad() {
//        Rank.show();
    }

    // public static show() {
    //     this.getRank1();
    // }

    /**
     * @param value
     */
    setScore(value: number) {
        // console.log("call wx.postMessage!!");
        wx.postMessage({
            event: 'setScore',
            score: value
        });
    }

    /**
     * @param value
     */
    public static setScore(value: number) {
        // console.log("call wx.postMessage!!");
        wx.postMessage({
            event: 'setScore',
            score: value
        });
    }

    /**
     * @param value
     */
    public static setScore2(value: number) {
        // console.log("call wx.postMessage!!");
        wx.postMessage({
            event: 'setScore2',
            score: value
        });
    }

    public static getRank() {
        wx.postMessage({
            event: 'getRank'
        });
    }

    public static getRank2() {
        wx.postMessage({
            event: 'getRank2'
        });
    }

}